<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="demo"></p>

    <script>
        class Person {
            constructor(name, age){
                this.name = name;
                this.age = age;
            }
            sayHello(){
                document.write(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
            }
        }
        let loong = new Person("Loong", 25);
        loong.sayHello();

    </script>
</body>
</html>